<?php

/**
 *  超级云短信
 */
class SuperCloud{
    private $Html = '';
    public $PhoneList = '';
    public $Mssage = '';
    /**
     * c        中国
     * c-xg     中国香港
     * dnym     东南亚缅甸
     */
    private $flg = ['+852'=>'c-xg', '+86'=>'c','+95'=>'dnym'];

    function __construct(){

        $this->getPhone();
    }

    // 获取号码
    function getPhone(){
        $this->Html = file_get_html('http://www.bfkdim.com/');
        var_dump($this->Html);
        die();
        var_dump($this->Html->find('div.phone_col_head')->plaintext);

        foreach ($this->Html->find('div.phone_col_head') as $v){
            var_dump($v->plaintext);
            $this->PhoneList[] = ['s','ghg'];
//
//            var_dump($v->find('a.phone')->plaintext);
        }
//            $this->PhoneList[] = $this->flg[$v->find('span.sup_phone')->plaintext]."_".$v->find('a.phone')->plaintext;
    }

    // 获取最近短信
    function getMessage($phone){
        $this->Html =  file_get_html('http://www.xnsms.com/test/getPhoneData?phone='.$phone);
        $number = 1;
        foreach ($this->Html->find('tr') as $v){
            if ($number != 1){
                $content['tel'] = $phone;
                $content['msg'] = $v->find('td',2)->plaintext;
                $content['time'] = $v->find('td',3)->plaintext;
                $this->Mssage[] = $content;
            }
            $number = 2;
        }
    }
}